Dynomotion

Group: DynoMotion Message: 1422 From: fermanz Date: 7/4/2011
Subject: Lathe axes runaway.
Hi Tom,
Every once in a while, if I am using the handwheels on the Hankook lathe, the Z (longitudinal ) axis will go into positive runaway and the only way to stop it is with EStop.
The axis will still show as enabled in KMotion.
Occasionally, instead of doing a runaway, the Z axis will oscillate violently.
I thought that I had fixed the problem when I detuned the speed Factor on Bit32 from 20 down to 10, as in the section of init.C below.

// Read Speed Selector

if (ReadBit(31)) // is X1 selected?
Factor = 0.200000;
else if (ReadBit(32)) // is X100 selected?
Factor = 10.0000000;
else // must be X10 then
Factor = 2.0000000;

if (!ReadBit(30))
{
// this is only executed if handwheels are enabled
// bit #30 is 1

ch0->Dest += Change1 * Factor;
ch1->Dest += Change1_2 * Factor;


This morning, for the first time, the X axis took off and it was only set on X10. An EStop was required to stop it.
Have I got something wrong in this section of code?

I was only turning the handwheel slowly, in the positive direction.

I so have a length of unshielded ribbon cable, which I am going to replace, in the cabinet but I have taken to switching out the handwheel encoders when I am stopping and starting the spindle, just in case it was a noise problem.
The spindle had been running for a while and I was just pulling the tool back out of a cut when it took off.

Any ideas?

Ross F
Group: DynoMotion Message: 1424 From: Tom Kerekes Date: 7/5/2011
Subject: Re: Lathe axes runaway.
Hi Ross,
 
The MPG program examples typically use a software technique to count the encoder pulses.  Using software has two advantages: It doesn't consume a hardware encoder input and it allows any two input pins to be used rather than only the IO connected to an encoder input.  The disadvantage of using software is that it has limited sample rate of ~5KHz.  This would normally limit the max counting rate for the MPG to 5,000 counts/sec before mis-counting would occur.  However the software technique listed in the examples uses a technique to monitor previous velocity to allow tracking much higher count rates.  It makes the assumption that there is limited acceleration so velocity can not change significantly in 1/5000th of a second.  This is normally a very reasonable assumption.  However if your encoders have very little mass or noise issues that sometimes add random counts the algorithm can get confused and think that the encoder is turning fast when it is not.  
 
 
Anyway to make a long story short, for the two MPG program find the two lines of:
 
 
  Change1 = NewPos - Pos;
  Change1_2 = NewPos - Pos_2;
 
 
and change them to:
 
  Change1 = 0;
  Change1_2 = 0;
and see if the runaway problem goes away.  You will then be limited to turning the handwheel at a speed of 5000 counts/sec.  For a 100 pulse (400 count) per rev MPG would be 5000/400*60 = 750 RPM.
 
Hope this helps.
TK
 


--- On Mon, 7/4/11, fermanz <ferman@...> wrote:

From: fermanz <ferman@...>
Subject: [DynoMotion] Lathe axes runaway.
To: DynoMotion@yahoogroups.com
Date: Monday, July 4, 2011, 6:11 PM

 
Hi Tom,
Every once in a while, if I am using the handwheels on the Hankook lathe, the Z (longitudinal ) axis will go into positive runaway and the only way to stop it is with EStop.
The axis will still show as enabled in KMotion.
Occasionally, instead of doing a runaway, the Z axis will oscillate violently.
I thought that I had fixed the problem when I detuned the speed Factor on Bit32 from 20 down to 10, as in the section of init.C below.

// Read Speed Selector

if (ReadBit(31)) // is X1 selected?
Factor = 0.200000;
else if (ReadBit(32)) // is X100 selected?
Factor = 10.0000000;
else // must be X10 then
Factor = 2.0000000;

if (!ReadBit(30))
{
// this is only executed if handwheels are enabled
// bit #30 is 1

ch0->Dest += Change1 * Factor;
ch1->Dest += Change1_2 * Factor;

This morning, for the first time, the X axis took off and it was only set on X10. An EStop was required to stop it.
Have I got something wrong in this section of code?

I was only turning the handwheel slowly, in the positive direction.

I so have a length of unshielded ribbon cable, which I am going to replace, in the cabinet but I have taken to switching out the handwheel encoders when I am stopping and starting the spindle, just in case it was a noise problem.
The spindle had been running for a while and I was just pulling the tool back out of a cut when it took off.

Any ideas?

Ross F

Group: DynoMotion Message: 1426 From: Ross Ferguson Date: 7/5/2011
Subject: Re: Lathe axes runaway.
Thanks Tom,
I will try that.
As the fault is intermittent, and rare, it may take a while before I can report whether it has cured the problem. :(
Ross

On 6/07/2011 2:58 AM, Tom Kerekes wrote:
 

Hi Ross,
 
The MPG program examples typically use a software technique to count the encoder pulses.  Using software has two advantages: It doesn't consume a hardware encoder input and it allows any two input pins to be used rather than only the IO connected to an encoder input.  The disadvantage of using software is that it has limited sample rate of ~5KHz.  This would normally limit the max counting rate for the MPG to 5,000 counts/sec before mis-counting would occur.  However the software technique listed in the examples uses a technique to monitor previous velocity to allow tracking much higher count rates.  It makes the assumption that there is limited acceleration so velocity can not change significantly in 1/5000th of a second.  This is normally a very reasonable assumption.  However if your encoders have very little mass or noise issues that sometimes add random counts the algorithm can get confused and think that the encoder is turning fast when it is not.  
 
 
Anyway to make a long story short, for the two MPG program find the two lines of:
 
 
  Change1 = NewPos - Pos;
  Change1_2 = NewPos - Pos_2;
 
 
and change them to:
 
  Change1 = 0;
  Change1_2 = 0;
and see if the runaway problem goes away.  You will then be limited to turning the handwheel at a speed of 5000 counts/sec.  For a 100 pulse (400 count) per rev MPG would be 5000/400*60 = 750 RPM.
 
Hope this helps.
TK
 


--- On Mon, 7/4/11, fermanz <ferman@...> wrote:

From: fermanz <ferman@...>
Subject: [DynoMotion] Lathe axes runaway.
To: DynoMotion@yahoogroups.com
Date: Monday, July 4, 2011, 6:11 PM

 
Hi Tom,
Every once in a while, if I am using the handwheels on the Hankook lathe, the Z (longitudinal ) axis will go into positive runaway and the only way to stop it is with EStop.
The axis will still show as enabled in KMotion.
Occasionally, instead of doing a runaway, the Z axis will oscillate violently.
I thought that I had fixed the problem when I detuned the speed Factor on Bit32 from 20 down to 10, as in the section of init.C below.

// Read Speed Selector

if (ReadBit(31)) // is X1 selected?
Factor = 0.200000;
else if (ReadBit(32)) // is X100 selected?
Factor = 10.0000000;
else // must be X10 then
Factor = 2.0000000;

if (!ReadBit(30))
{
// this is only executed if handwheels are enabled
// bit #30 is 1

ch0->Dest += Change1 * Factor;
ch1->Dest += Change1_2 * Factor;

This morning, for the first time, the X axis took off and it was only set on X10. An EStop was required to stop it.
Have I got something wrong in this section of code?

I was only turning the handwheel slowly, in the positive direction.

I so have a length of unshielded ribbon cable, which I am going to replace, in the cabinet but I have taken to switching out the handwheel encoders when I am stopping and starting the spindle, just in case it was a noise problem.
The spindle had been running for a while and I was just pulling the tool back out of a cut when it took off.

Any ideas?

Ross F


-- 
Ferguson Windmills Company
835 Old North Road,
R.D.2,    Waimauku,
New Zealand.  0882
Ph 64 9  411 8332       Mobile 027 282 7689
Fax 64 9 412 8655
E-mail   -  ferman@... 
http://www.windmills.co.nz
Group: DynoMotion Message: 1639 From: Ross Ferguson Date: 8/3/2011
Subject: Re: Lathe axes runaway.
Hi Tom,
I have only just had time to revisit this problem and we have replaced the flat ribbon cable, off the 16 pin JP6 header, with shielded ribbon cable and that seems to have improved things, although the original runaway was very intermittent.
If we ground the shield where should it be? On the board or to the frame?

I also tried the change that you suggested -
  Change1 = NewPos - Pos;
  Change1_2 = NewPos - Pos_2;
 
and change them to:
 
  Change1 = 0;
  Change1_2 = 0;

but all I got was violent oscillation of the axes when I powered up the servos.
Changed it back and it seems okay again.
Was there anything else I should have altered in the Init.c file?

Ross

On 6/07/2011 2:58 AM, Tom Kerekes wrote:
 

Hi Ross,
 
The MPG program examples typically use a software technique to count the encoder pulses.  Using software has two advantages: It doesn't consume a hardware encoder input and it allows any two input pins to be used rather than only the IO connected to an encoder input.  The disadvantage of using software is that it has limited sample rate of ~5KHz.  This would normally limit the max counting rate for the MPG to 5,000 counts/sec before mis-counting would occur.  However the software technique listed in the examples uses a technique to monitor previous velocity to allow tracking much higher count rates.  It makes the assumption that there is limited acceleration so velocity can not change significantly in 1/5000th of a second.  This is normally a very reasonable assumption.  However if your encoders have very little mass or noise issues that sometimes add random counts the algorithm can get confused and think that the encoder is turning fast when it is not.  
 
 
Anyway to make a long story short, for the two MPG program find the two lines of:
 
 
  Change1 = NewPos - Pos;
  Change1_2 = NewPos - Pos_2;
 
 
and change them to:
 
  Change1 = 0;
  Change1_2 = 0;
and see if the runaway problem goes away.  You will then be limited to turning the handwheel at a speed of 5000 counts/sec.  For a 100 pulse (400 count) per rev MPG would be 5000/400*60 = 750 RPM.
 
Hope this helps.
TK
 


--- On Mon, 7/4/11, fermanz <ferman@...> wrote:

From: fermanz <ferman@...>
Subject: [DynoMotion] Lathe axes runaway.
To: DynoMotion@yahoogroups.com
Date: Monday, July 4, 2011, 6:11 PM

 
Hi Tom,
Every once in a while, if I am using the handwheels on the Hankook lathe, the Z (longitudinal ) axis will go into positive runaway and the only way to stop it is with EStop.
The axis will still show as enabled in KMotion.
Occasionally, instead of doing a runaway, the Z axis will oscillate violently.
I thought that I had fixed the problem when I detuned the speed Factor on Bit32 from 20 down to 10, as in the section of init.C below.

// Read Speed Selector

if (ReadBit(31)) // is X1 selected?
Factor = 0.200000;
else if (ReadBit(32)) // is X100 selected?
Factor = 10.0000000;
else // must be X10 then
Factor = 2.0000000;

if (!ReadBit(30))
{
// this is only executed if handwheels are enabled
// bit #30 is 1

ch0->Dest += Change1 * Factor;
ch1->Dest += Change1_2 * Factor;

This morning, for the first time, the X axis took off and it was only set on X10. An EStop was required to stop it.
Have I got something wrong in this section of code?

I was only turning the handwheel slowly, in the positive direction.

I so have a length of unshielded ribbon cable, which I am going to replace, in the cabinet but I have taken to switching out the handwheel encoders when I am stopping and starting the spindle, just in case it was a noise problem.
The spindle had been running for a while and I was just pulling the tool back out of a cut when it took off.

Any ideas?

Ross F


-- 
Ferguson Windmills Company
835 Old North Road,
R.D.2,    Waimauku,
New Zealand.  0882
Ph 64 9  411 8332       Mobile 027 282 7689
Fax 64 9 412 8655
E-mail   -  ferman@... 
http://www.windmills.co.nz
Group: DynoMotion Message: 1640 From: Tom Kerekes Date: 8/3/2011
Subject: Re: Lathe axes runaway.
Hi Ross,
 
I think grounding the shield at the KFLOP end to a KFLOP DC ground would be the best bet.  Connecting the shield to a possibly noisy frame ground could even make matters worse.
 
I can't imagine how forcing the MPG changes to zero would cause the servos to be unstable.   But actually re-looking at the code forcing them to zero where I suggested would stop the MPG from ever causing any change.  Rather they should be zeroed after they are used.  If you send me the original file as well as the changed file I can check them for you as well as try to make the change to ignore previous velocity.
 
Thanks
TK

--- On Wed, 8/3/11, Ross Ferguson <ferman@...> wrote:

From: Ross Ferguson <ferman@...>
Subject: Re: [DynoMotion] Lathe axes runaway.
To: DynoMotion@yahoogroups.com
Date: Wednesday, August 3, 2011, 1:04 AM

 
Hi Tom,
I have only just had time to revisit this problem and we have replaced the flat ribbon cable, off the 16 pin JP6 header, with shielded ribbon cable and that seems to have improved things, although the original runaway was very intermittent.
If we ground the shield where should it be? On the board or to the frame?

I also tried the change that you suggested -
  Change1 = NewPos - Pos;
  Change1_2 = NewPos - Pos_2;
 
and change them to:
 
  Change1 = 0;
  Change1_2 = 0;

but all I got was violent oscillation of the axes when I powered up the servos.
Changed it back and it seems okay again.
Was there anything else I should have altered in the Init.c file?

Ross

On 6/07/2011 2:58 AM, Tom Kerekes wrote:
 
Hi Ross,
 
The MPG program examples typically use a software technique to count the encoder pulses.  Using software has two advantages: It doesn't consume a hardware encoder input and it allows any two input pins to be used rather than only the IO connected to an encoder input.  The disadvantage of using software is that it has limited sample rate of ~5KHz.  This would normally limit the max counting rate for the MPG to 5,000 counts/sec before mis-counting would occur.  However the software technique listed in the examples uses a technique to monitor previous velocity to allow tracking much higher count rates.  It makes the assumption that there is limited acceleration so velocity can not change significantly in 1/5000th of a second.  This is normally a very reasonable assumption.  However if your encoders have very little mass or noise issues that sometimes add random counts the algorithm can get confused and think that the encoder is turning fast when it is not.  
 
 
Anyway to make a long story short, for the two MPG program find the two lines of:
 
 
  Change1 = NewPos - Pos;
  Change1_2 = NewPos - Pos_2;
 
 
and change them to:
 
  Change1 = 0;
  Change1_2 = 0;
and see if the runaway problem goes away.  You will then be limited to turning the handwheel at a speed of 5000 counts/sec.  For a 100 pulse (400 count) per rev MPG would be 5000/400*60 = 750 RPM.
 
Hope this helps.
TK
 


--- On Mon, 7/4/11, fermanz <ferman@...> wrote:

From: fermanz <ferman@...>
Subject: [DynoMotion] Lathe axes runaway.
To: DynoMotion@yahoogroups.com
Date: Monday, July 4, 2011, 6:11 PM

 
Hi Tom,
Every once in a while, if I am using the handwheels on the Hankook lathe, the Z (longitudinal ) axis will go into positive runaway and the only way to stop it is with EStop.
The axis will still show as enabled in KMotion.
Occasionally, instead of doing a runaway, the Z axis will oscillate violently.
I thought that I had fixed the problem when I detuned the speed Factor on Bit32 from 20 down to 10, as in the section of init.C below.

// Read Speed Selector

if (ReadBit(31)) // is X1 selected?
Factor = 0.200000;
else if (ReadBit(32)) // is X100 selected?
Factor = 10.0000000;
else // must be X10 then
Factor = 2.0000000;

if (!ReadBit(30))
{
// this is only executed if handwheels are enabled
// bit #30 is 1

ch0->Dest += Change1 * Factor;
ch1->Dest += Change1_2 * Factor;

This morning, for the first time, the X axis took off and it was only set on X10. An EStop was required to stop it.
Have I got something wrong in this section of code?

I was only turning the handwheel slowly, in the positive direction.

I so have a length of unshielded ribbon cable, which I am going to replace, in the cabinet but I have taken to switching out the handwheel encoders when I am stopping and starting the spindle, just in case it was a noise problem.
The spindle had been running for a while and I was just pulling the tool back out of a cut when it took off.

Any ideas?

Ross F


-- 
Ferguson Windmills Company
835 Old North Road,
R.D.2,    Waimauku,
New Zealand.  0882
Ph 64 9  411 8332       Mobile 027 282 7689
Fax 64 9 412 8655
E-mail   -  ferman@... 
http://www.windmills.co.nz